import ReactDOM from "react-dom/client";
import { RouterProvider, createBrowserRouter } from "react-router-dom";

import "./index.css";

import Root from "./routers/root";
import Home from "./routers/home";

import ErrorPage from "./pages/404Page";
import Html from "./routers/html";
import Bbcode from "./routers/bbcode";
import Markdown from "./routers/markdown";

const router = createBrowserRouter([
  {
    path: "/",
    element: <Root />,
    errorElement: <ErrorPage />,
    children: [
      {
        index: true,
        element: <Home />,
      },
      {
        path: '/html',
        element: <Html />,
      },
      {
        path: '/bbcode',
        element: <Bbcode />,
      },
      {
        path: '/markdown',
        element: <Markdown />,
      },
    ],
  },
]);

ReactDOM.createRoot(document.getElementById("root")).render(
  <RouterProvider router={router} />
);
